package com.ease.dao.dialect;

import com.ease.common.util.Assertion;
import com.ease.common.util.Detect;
import com.ease.common.vo.Pagination;
import com.ease.dao.DataAccessObjectConst;

/**
 * 
 * @author nathanleewei
 * 
 */
public abstract class AbstractJdbcTemplateDialect extends Detect implements JdbcTemplateDialect, DataAccessObjectConst {

	public String paginationStatement(String namedStatement, Pagination<?> pagination) {
		Assertion.notEmpty(namedStatement, "namedStatement not found");
		Assertion.notNull(pagination, "pagination not found");

		int _skipResult = pagination.getStart();
		int _maxResult = pagination.getStart() + pagination.getSize();
		return paginationStatement(namedStatement, _skipResult, _maxResult);
	}
}
